<template>
    <view>
        <wxTopStatus backgroundColor="#fff">
            <view class="nav-title"> 新增粉丝 </view>
        </wxTopStatus>

        <MeScrollPage
            type="body"
            :config="{}"
            ref="MeScrollPageREF"
            :page="page"
            @onGetListLafer="batchRead"
        >
            <view class="p-[30rpx] flex-column gap-[20rpx]">
                <template v-for="item in page.data" :key="item.id">
                    <detailComcern
                        :info="{
                            ...item,
                            uid: item.bindId,
                            userType: 1,
                            intro: '关注了你 ' + item.createTime
                        }"
                        idName="uid"
                        typeKey="userType"
                        @reGetData="MeScrollPageREF.resetData"
                    ></detailComcern>
                </template>
            </view>
        </MeScrollPage>
    </view>
</template>
<script setup lang="ts">
import detailComcern from '../components/detaiConcern/index.vue'
import { messagePageAPI, messageReadBatchAPI } from '@/api/message'
import { PageProps } from '@/hooks/usePage'
const MeScrollPageREF = ref()

const page = reactive<PageProps>({
    params: {
        bizTab: 4, // 业务tab：1.系统通知 2.服务通知 3.评论 4.新粉丝 5.赞/收藏
        size: 20
    },
    fetchData: messagePageAPI
})

//批量已读粉丝
const batchRead = () => {
    messageReadBatchAPI({
        type: [5],
        ids: (page.data as any[]).map((item: any) => item.id)
    })
}
</script>

<style scoped lang="scss"></style>
